<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body,html,#allmap {
	width: 100%;
	height: 100%;
	overflow: hidden;
	margin: 0;
}

#l-map {
	height: 100%;
	width: 78%;
	float: left;
	border-right: 2px solid #bcbcbc;
}

#r-result {
	height: 100%;
	width: 20%;
	float: left;
}
</style>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.3"></script>
<title>点击获取坐标</title>
<#include "../../commonUse.html"/>
</head>
<body>
	<div id="allmap"></div>
</body>
</html>

<script type="text/javascript">
/* 
 *功能：在弹出矿中显示百度地图，
 点击地图后会自动关闭窗口，在父项
 页面中 id为lat 和id为lng的会自动回填经纬度
 **/

	//调用本页面的页面传过来的经纬度
	var lat="";
	var lng="";
	
	var map = new BMap.Map("allmap");
	var point ;
	if(lat!=''&&lng!=''){
		point = new BMap.Point(lng,lat);
		map.centerAndZoom(point, 15);
		var marker = new BMap.Marker(point);  
		map.addOverlay(marker);
	}else{
		point = new BMap.Point(119.307106,26.087067);//福州三坊七巷为地图中心
		map.centerAndZoom(point, 15);
		//var marker = new BMap.Marker(point);  
		//map.addOverlay(marker); 
	}

	
	map.enableScrollWheelZoom();
	map.enableContinuousZoom();
	map.addEventListener("click", showInfo);
	
	
	//***********************地址解析类 
	var gc = new BMap.Geocoder();
	
	function showInfo(e) {
		//alert(e.point.lng + ", " + e.point.lat);
		/* var point = new BMap.Point(e.point.lng, e.point.lat);
		map.centerAndZoom(point, 15);
		var marker = new BMap.Marker(point);  
		map.addOverlay(marker);  */ 
		alert(e.point.lat);
		alert(e.point.lng);
	
	}  

	
</script>
